const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
const axisProps = require('../tw-lib-base/chart/axis-props')
const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  ...axisProps,
  ...datazoomProps,
  ...tooltipProps,

  height: {
    type: String,
    default: '300px',
    name: '图表容器高度',
    filedType: 'string'
  },

  data: {
    type: Array,
    default () {
      return [
        ['姓名', '张思睿'],
        ['语文', 43.3],
        ['数学', 83.1],
        ['英语(张三)', 86.4],
        ['物理', 84.4]
      ]
    },
    name: '图表数据集',
    filedType: 'api'
  },

  yLabel: {
    type: String,
    default: '',
    name: '坐标轴单位',
    filedType: 'string'
  },
  yName: {
    type: String,
    default: 'Y坐标轴标题',
    name: 'Y坐标轴标题',
    filedType: 'string'
  },
  xName: {
    type: String,
    default: 'X坐标轴标题',
    name: 'X坐标轴标题',
    filedType: 'string'
  },
  yNamePadding: {
    type: String,
    default: '0,0,-10,100',
    name: 'Y轴名称位置偏移',
    filedType: 'string'
  },
  nameStyleColor: {
    type: String,
    default: '',
    name: '坐标轴标题颜色',
    filedType: 'color'
  },
  nameStyleSize: {
    type: String,
    default: '',
    name: '坐标轴标题字体',
    filedType: 'string'
  },


  xLabelRotate: {
    type: String,
    default: '0',
    name: 'X坐标旋转角度',
    filedType: 'string'
  },
  yLabelRotate: {
    type: String,
    default: '0',
    name: 'Y坐标旋转角度',
    filedType: 'string'
  },
  barMaxWidth: {
    type: String,
    default: '50%',
    name: '柱子最大宽度',
    filedType: 'string'
  },
  showBarLabel: {
    type: Boolean,
    default: true,
    name: '显示柱子标签',
    filedType: 'switch'
  },
  barPosition: {
    type: String,
    default: 'top',
    name: '柱子标签位置',
    filedType: 'string'
  },
  barFontSize: {
    type: String,
    default: '16',
    name: '柱子标签字体',
    filedType: 'string'
  },

  useXAxisFun: {
    type: Boolean,
    default: false,
    name: '启用坐标刻度函数',
    filedType: 'switch'
  },

  useTooltipFun: {
    type: Boolean,
    default: true,
    name: '启用tooltip函数',
    filedType: 'switch'
  },

  tooltipData: {
    type: Array,
    default () {
      return [
        ['语文', '张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰'],
        ['数学', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰'],
        ['英语(张三)', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰'],
        ['物理', '1张三丰', '2张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰', '张三丰']
      ]
    },
    name: 'tooltip数据集',
    filedType: 'api'
  },

  ...nodata
}
